<?php

namespace IDock\IDock;

use Exception;
use IDock\Http\Response;
use IDock\Visitor\NonCar\NonCarPaymentVisitor;
use IDock\Visitor\NonCar\NonCarProductListVisitor;

/**
 * 非车接口
 */
trait IDockNonCar
{

    /**
     * 非车产品列表
     * @param $shortName
     * @param NonCarProductListVisitor $nonCarProductListVisitor
     * @return Response
     * @throws Exception
     */
    public function nonCarProductList($shortName, NonCarProductListVisitor $nonCarProductListVisitor): Response
    {
        $insurance = $this->getBean($shortName);

        return $insurance->nonCarProductList($nonCarProductListVisitor);
    }


    /**
     * 非车支付
     * @param $shortName
     * @param NonCarPaymentVisitor $paymentVisitor
     * @return Response
     * @throws Exception
     * @version 4.0
     */
    public function nonCarPayment($shortName, NonCarPaymentVisitor $paymentVisitor): Response
    {
        $insurance = $this->getBean($shortName);

        return $insurance->nonCarInquiry($paymentVisitor);
    }
}